<!--
  ~ Copyright 2010 Pierre Heinzerling, Uwe Janner, Patrick Wright
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <script type="text/javascript" src="js/util.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
    <script type="text/javascript" src="js/local-storage.js"></script>
    <script type="text/javascript" src="js/toolinsky-server.js"></script>
    <link type="text/css" rel="stylesheet" href="css/options.css">
    <title>Publinksky Options</title>
    <script type="text/javascript">
        function restoreOptions() {
            if (lsGetOptionsPollingEnabled()) {
                elem("polling_enabled").checked = true;
                elem("polling_time_sec").enabled = true;
            } else {
                elem("polling_enabled").checked = false;
                elem("polling_time_sec").enabled = false;
            }
            elem("polling_time_sec").value = lsGetOptionsPollingTimeSec();

			// initialize hotkey
			if (loadHotkeyConfig()) {
				$("#config_hotkey").val( loadHotkeyConfig() );
			}
        }
        function saveOptions() {
            lsSetOptionsPollingEnabled(elem("polling_enabled").checked);
            var s = elem("polling_time_sec").value;
            if (s.length > 0) {
                lsSetOptionsPollingTimeSec(s);
            }
            storeHotkeyConfig( $("#config_hotkey").val() );

            $("#storedMsg").fadeIn(100);
            setTimeout(function(){$("#storedMsg").fadeOut(100)}, 3000);
        }
    </script>
</head>
<body onload="restoreOptions()">
<h1><img src="icons/arrow_in.png" style="border:0" width="32" height="32" /> Publinksky</h1>
<h2>Options</h2>
<table cellpadding="5">
    <tr>
    	<td class="col1">Hotkey for "Add Tab to current Theme"</td>
    	<td>
			<select id="config_hotkey">
				<option value=""> -- disabled -- </option>
				<option value="F1">F1</option>
				<option value="F2">F2</option>
				<option value="F3">F3</option>
				<option value="F4">F4</option>
				<option value="F5">F5</option>
				<option value="F6">F6</option>
				<option value="F7">F7</option>
				<option value="F8">F8</option>
				<option value="F9">F9</option>
				<option value="F10">F10</option>
			</select>
    	</td>
    </tr>
    <tr>
        <td class="col1">Enable notifications/polling</td>
        <td><input type="checkbox" value="0" checked="0" id="polling_enabled"/></td>
    </tr>
    <tr>
        <td class="col1">Polling time (seconds)</td>
        <td><input type="text" value="300" id="polling_time_sec"/></td>
    </tr>
    <tr>
        <td colspan="2" align="right"><input type="button" onclick="saveOptions()" value="Save" /></td>
    </tr>
</table>
<br>
<div id="storedMsg">Options saved.</div>
<div>
<br /><br /><br /><br />
<b>Need help or want to know more?</b><br />
Check out this document: <a href="http://docs.google.com/Doc?docid=0AQrBfAtyS2_yZGZjY2pjeG5fOWNodm05cGM0">http://docs.google.com/Doc?docid=0AQrBfAtyS2_yZGZjY2pjeG5fOWNodm05cGM0</a>
</div>
</body>
</html>